Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: scripts affecting intellisense #900

Merged
merged 5 commits into from
Jul 16, 2024
Merged

Conversation

Princesseuh
Copy link
Member

@Princesseuh Princesseuh commented Jul 11, 2024

Changes

Requires withastro/compiler#1019

This PR reworks how script and style are extracted from files, using the compiler's information instead of crawling through various ASTs. This makes file updates simpler, much faster, and also more correct as the ASTs sometimes had wrong or misleading positions due to how they were being generated.

Fixes #800
Fixes #862
This PR also fixes an issue where CSS selection ranges didn't work inside style tags, reported on Discord

Testing

Tests should pass!

Docs

N/A

Copy link

changeset-bot bot commented Jul 11, 2024

🦋 Changeset detected

Latest commit: db9f309

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@astrojs/language-server Minor
astro-vscode Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment on lines -113 to -114
* TODO: Merge this with `findEmbeddedCSS`? Unlike scripts, there's no scoping being done here, so merging all of it in
* the same virtual file is possible, though it might make mapping more tricky.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the case now in the new format, which improves intellisense for class names and stuff when you have multiple style tags in the same file. Kinda unlikely, but still funny!

@Princesseuh Princesseuh merged commit d993c0d into main Jul 16, 2024
4 checks passed
@Princesseuh Princesseuh deleted the fix/script-intellisense branch July 16, 2024 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants